package com.lianxi.Courses.service;

import com.github.pagehelper.PageInfo;
import com.lianxi.Courses.entity.*;
import com.lianxi.Courses.exception.CourseExistException;
import com.lianxi.Courses.exception.FileUploadErrorException;
import com.lianxi.Courses.exception.RequestParameterErrorException;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import java.util.List;
import javax.servlet.http.HttpSession;

public interface CourseService {
    void addCourse(String courseName, String courseInfo, String author, CommonsMultipartFile file, String recommendationGrade,String courseTypeId, HttpSession session) throws RequestParameterErrorException, CourseExistException, FileUploadErrorException;

//    PageInfo<Course> findPage(String pageNo, String pageSize);
    PageInfo<Course> findPage(Course courseParam, String pageNo, String pageSize);

    Course findById(String id) throws RequestParameterErrorException;
    void modifyCourse(String id,String courseName, String courseInfo, String author, CommonsMultipartFile file, String recommendationGrade,String courseTypeId, HttpSession session) throws RequestParameterErrorException, CourseExistException, FileUploadErrorException;
    void modifyStatus(String id,String status) throws RequestParameterErrorException;

    //查询子类别
    List<Course>findByCourseTypeId(String courseTypeId) throws RequestParameterErrorException;

    //根据课程，查所有
    Course findByIdAll(String id) throws RequestParameterErrorException;

    //根据课程的课程类别，查点赞前三的课程
    List<Course> findByTypeId(String courseTypeId) throws RequestParameterErrorException;



    //获取所有课程，按点击量从小到大排序
    List<Course> getAllCourses() throws RequestParameterErrorException;

    PageInfo<Course> findPageByExample(CourseExample example, String pageNo, String pageSize);





}
